package com.fzu.ess.ess.service.Impl;

import com.fzu.ess.ess.dao.LanguageDao;
import com.fzu.ess.ess.entity.Language;
import com.fzu.ess.ess.service.LanguageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by ercha on 2015/10/25.
 */
@Service
public class LanguageServiceImpl implements LanguageService {
    @Autowired
    private LanguageDao languageDao;

    @Override
    public String create(Language language) {
        try {
            return (String) languageDao.save(language);
        } catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public List<Language> getAll() {
        try{
            return languageDao.find("from Language");
        } catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }
}
